package com.github.ecbp.user.service.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.github.ecbp.common.data.mapper.BaseMapper;
import com.github.ecbp.user.service.entity.TMenu;
import com.github.ecbp.user.service.entity.TPermission;
import com.github.ecbp.user.service.entity.TPermissionMenuRelation;
import com.github.ecbp.user.service.response.PermissionRes;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 后台权限(按钮)菜单关系表 Mapper 接口
 * </p>
 *
 * @author zj2626
 * @since 2020-03-26
 */
public interface PermissionMenuRelationMapper extends BaseMapper<TPermissionMenuRelation> {
    List<PermissionRes> getPermissionVoByMenuId(@Param(Constants.WRAPPER) Wrapper<TPermissionMenuRelation> wrapper);

    /**
     * 通过菜单ID查询权限信息
     *
     * @param wrapper
     * @return java.util.Set<com.ecbp.service.user.entity.TPermission>
     * @author zj2626
     * @date 2020/5/12
     */
    List<TPermission> getPermissionByMenuId(@Param(Constants.WRAPPER) Wrapper<TPermissionMenuRelation> wrapper);


    /**
     * 通过权限ID查询菜单信息
     *
     * @param wrapper
     * @return java.util.Set<com.ecbp.service.user.entity.TMenu>
     * @author zj2626
     * @date 2020/5/12
     */
    List<TMenu> getMenuByPermissionId(@Param(Constants.WRAPPER) Wrapper<TPermissionMenuRelation> wrapper);

}
